package com.cyb.beta.controller;

import com.cyb.beta.core.Constant;
import com.cyb.beta.model.User;
import com.cyb.beta.service.LoginLogService;
import com.jfinal.ext.route.ControllerBind;

/**
 * Created by Administrator on 2015/6/12.
 */
@ControllerBind(controllerKey = "/admin/loginLog", viewPath = "admin/system")
public class LoginLogController extends BaseController {

    private LoginLogService service = new LoginLogService();

    public void index() {
        keepModel(User.class);
        keepPara("startTime", "endTime");
        User user = getModel(User.class);
        int pageNumber = getParaToInt(Constant.PAGENUM, 1);
        int pageSize = getParaToInt(Constant.PAGESIZE, Constant.DEFAULTPAGESIZE);
        setAttr("pageList", service.getLoginLogPage(pageNumber, pageSize, user, getPara("startTime"), getPara("endTime")));
        render("logList.html");
    }
}
